var FloatDiv = {
    initFloat : function(param){
        var domId = param.dom.id;
        var mark = domId != '' ? domId : (new Date().getTime() + '');
        var htmlStr = '<div class="white_content float_box_light_' + mark + '"></div><div class="black_overlay float_box_fade_' + mark + '"><div id="float_close_'+mark+'" class="float_close"></div></div>';
        var floatBox = {
            url : param.url,
            onClose : param.onClose,
            load : function(){
                var xhr = new XMLHttpRequest();
                xhr.open('GET', this.url, true);
                xhr.onreadystatechange = function() {
                    if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) {
                        return floatBox.open(xhr.responseText);
                    }
                };
                xhr.send();
            },
            open : function (text) {
                var contentBox = document.getElementsByClassName('float_box_light_' + mark)[0];
                if(text != undefined && text != null && text != '')contentBox.innerHTML = text;
                contentBox.style.display='block';
                document.getElementsByClassName('float_box_fade_' + mark)[0].style.display='block';
            },
            close : function () {
                document.getElementsByClassName('float_box_light_' + mark)[0].style.display='none';
                document.getElementsByClassName('float_box_fade_' + mark)[0].style.display='none';
                this.onClose();
            }
        };

        param.dom.innerHTML = htmlStr;
        document.getElementById('float_close_' + mark).onclick = function(){floatBox.close()};

        return floatBox;
    }
};